package com.wjl.picture.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wjl.picture.picture.model.entity.Space;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wjl.picture.picture.model.request.SpaceAddRequest;
import com.wjl.picture.picture.model.request.SpaceQueryRequest;
import com.wjl.picture.picture.model.vo.SpaceVO;
import com.wjl.picture.user.model.entity.User;

import java.util.List;

/**
* @author jdd
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2024-12-20 10:02:51
*/
public interface SpaceService extends IService<Space> {
    /**
     * 添加空间
     * @param spaceAddRequest
     * @return
     */
    long addSpace(SpaceAddRequest spaceAddRequest);
    /**
     * 校验
     *
     * @param post
     * @param add
     */
    void validSpace(Space post, boolean add);

    /**
     * 获取查询条件
     *
     * @param postQueryRequest
     * @return
     */
    LambdaQueryWrapper<Space> getLambdaQueryWrapper(SpaceQueryRequest postQueryRequest);
    /**
     * 获取帖子封装
     *
     * @param post
     * @return
     */
    SpaceVO getSpaceVO(Space post);

    /**
     * 分页获取帖子封装
     *
     * @param postPage
     * @return
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> postPage);

    /**
     * 分页查询帖子
     * @param postQueryRequest
     * @return
     */
    Page<SpaceVO> listSpaceVOByPage(SpaceQueryRequest postQueryRequest);

    /**
     * 校验删除请求
     * @param ids
     * @param user
     * @return
     */
    void validDelete(List<Long> ids, User user);

    /**
     *  填充空间等级
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);

    void checkSpaceAuth(Space space);
}
